# -*- coding: utf-8 -*-
import numpy as np
import cv2

#拉普拉斯金字塔=原图像-先下采样后上采样的图像
def cv_show(img,name,writename):
    cv2.imshow(name,img)
    cv2.imwrite(writename,img)
    cv2.waitKey()
    cv2.destroyAllWindows()
img = cv2.imread('lena.png')
down = cv2.pyrDown(img)
down_up = cv2.pyrUp(down)
Laplace = img - down_up
res = np.hstack((img,Laplace))
cv_show(res,'res','Laplace.png')#